﻿using SoftwareConsulting.BI11.NumericalMethods.Interfaces;

namespace SoftwareConsulting.BI11.NumericalMethods.Optimization
{
    /// <summary>
    /// Класс фабрики точек и векторов, подозрительных на минимум
    /// </summary>
    public class SuspiciousMinimumPointAndVectorFactory : SuspiciousOptimalPointAndVectorFactory
    {
        /// <summary>
        /// Конструктор класса
        /// </summary>
        public SuspiciousMinimumPointAndVectorFactory() : 
            base()
        {
        }

        /// <summary>
        /// Создает точку, подозрительную на минимум
        /// </summary>
        /// <param name="argument"></param>
        /// <param name="function"></param>
        /// <returns></returns>
        public override SuspiciousOptimalPoint CreatePoint(double argument, IOneVariableFunction function)
        {
            return new SuspiciousMinimumPoint(argument, function);
        }

        /// <summary>
        /// Создает вектор, подозрительный на минимум
        /// </summary>
        /// <param name="argument"></param>
        /// <param name="function"></param>
        /// <returns></returns>
        public override SuspiciousOptimalVector CreateVector(double[] argument, IManyVariableFunction function)
        {
            return new SuspiciousMinimumVector(argument, function);
        }
    }
}
